package com.qst.yunpan.service;

import com.qst.yunpan.pojo.FileCustom;
import com.qst.yunpan.pojo.RecycleFile;
import com.qst.yunpan.pojo.SummaryFile;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.util.List;

public interface FileService {
    public static final String PREFIX = "WEB-INF" + File.separator + "file" + File.separator;


    // 新建对应的文件夹
    void addNewNameSpace(HttpServletRequest request, String nameSpace);

    // 获取文件名
    String getFileName(HttpServletRequest request, String fileName);
    String getFileName(HttpServletRequest request, String fileName, String username);

    // 得到文件list
    List<FileCustom> listFile(String realPath);

    // 上传文件
    void uploadFilePath(HttpServletRequest request, MultipartFile[] files, String currentPath) throws Exception;

    // 文件下载
    File downPackage(HttpServletRequest request, String currentPath, String[] fileNames, String username) throws Exception;

    // 删除打包文件
    void deleteDownPackage(File downloadFile) throws Exception;

    // 新增目录
    boolean addDirectory(HttpServletRequest request, String currentPath, String directoryName);

    // 文件分类查询
    List<FileCustom> searchFile(HttpServletRequest request, String currentPath,String reg, String regType);

    // 删除文件
    void delDirectory(HttpServletRequest request, String currentPath, String[] directoryName) throws Exception;

    // 获得回收站路径
    String getRecyclePath(HttpServletRequest request);

    // 重命名文件
    Boolean renameDirectory(HttpServletRequest request, String currentPath, String srcName, String destName);

    // 获取文件路径
    SummaryFile summarylistFile(String realPath, int number);

    // 处理复制功能
    void copyDirectory(HttpServletRequest request, String currentPath, String[] directoryName,String targetdirectorypath) throws Exception;

    // 移动
    void moveDirectory(HttpServletRequest request, String currentPath, String[] directoryName, String targetdirectorypath) throws Exception;

    // 显示回收站文件
    List<RecycleFile> recycleFiles(HttpServletRequest request) throws Exception;

    // 还原文件
    void revertDirectory(HttpServletRequest request, int[] fileId) throws Exception;

    // 清空回收站
    void delAllRecycle(HttpServletRequest request) throws Exception;

}
